﻿@using NewRen.Models;
@using NewRen.Models.ViewModel;
@{
    ViewBag.Title = "首页";
    Layout = null;
    List<vIndustryGroup> vindustriesGroup = ViewBag.IndustriesGroup;
    List<vIndustryBusiness> vindystriesBusiness = ViewBag.IndustriesBusiness;
    List<UserRecommend> Recommend = ViewBag.Recommmends as List<UserRecommend>;
}
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="mmtrix-verification" content="4u1c3y34xzsyaeg8b5unxivfvqxlczw7jn9cc270sqosuvqwrb9ejuj4b7gew2b5" />
    <meta name="keywords" content="@ViewBag.Keywords" />
    <meta name="description" content="@ViewBag.Description" />
    <title>@ViewBag.Title—@ViewBag.BaseTitle</title>
    <link href="~/Styles/jquery.datetimepicker.css" rel="stylesheet" />
    <link href="~/Styles/newren.base.css" rel="stylesheet" />
    <link href="~/Styles/newren.css" rel="stylesheet" />
    <link rel="shortcut icon" href="~/Images/favicon.ico" />
    <script src="~/Scripts/jquery-1.10.2.min.js"></script>
    <script src="~/Scripts/jquery.imgscroll.js"></script>
    <script src="~/Scripts/jquery.datetimepicker.js"></script>
    <script src="~/Scripts/newren.base.js"></script>
    <script src="~/Scripts/newren.user.js"></script>
    <script src="~/Scripts/newren.js"></script>
</head>
<body>
    <div class="nav">
        <div class="nav-container">
            <div class="nav-left">
                <span style="margin-right:10px">欢迎光临</span>
                现在是<span id="nav_time"></span>
                <script>
                    function DateNow() {
                        var d = new Date()
                        var vYear = d.getFullYear()
                        var vMon = d.getMonth() + 1
                        var vDay = d.getDate()
                        var h = d.getHours();
                        var m = d.getMinutes();
                        var se = d.getSeconds();
                        s = vYear + "年" + (vMon < 10 ? "0" + vMon : vMon) + "月" + (vDay < 10 ? "0" + vDay : vDay) + "日 " + (h < 10 ? "0" + h : h) + ":" + (m < 10 ? "0" + m : m) + ":" + (se < 10 ? "0" + se : se);
                        $("#nav_time").html(s);//输出时间
                    }
                    setInterval(DateNow, 1000);
                </script>
            </div>
            <div class="nav-right">
                @if (!User.Identity.IsAuthenticated || Session["usertype"] == null)
                {
                    <a href="/Login" class="item-info">登陆</a>
                    <span>|</span>
                    <a href="/Register" class="item-info">注册</a>
                }
                else
                {
                    <input type="hidden" id="hdusername" value="@ViewBag.CurrentUser.CurrentName" />
                    if (ViewBag.CurrentUser.UserType == UserType.User)
                    {
                        <a class="item"><span id="browsespan">我的浏览记录</span></a>
                        <a class="item" href="@ViewBag.CurrentUser.Show" target="_self">
                            <span class="user_name_show">@ViewBag.CurrentUser.CurrentName</span>
                        </a>
                        <a class="item last" href="/User/Logout?sid=@ViewBag.SID" target="_self">注销</a>
                        <div id="browseshow">
                            <a><div id="clearbr">清除浏览记录</div></a>
                            @foreach (var br in ViewBag.browserecords as IEnumerable<BrowseRecord>)
                    {
                                <a href="@br.URL">
                                    <div class="brshow">
                                        <span class="browseshow-left">@br.Title</span>
                                        <span class="browseshow-right">@br.Time</span>
                                    </div>
                                </a>
                            }
                        </div>
                    }
                    else
                    {
                        <a class="item" href="@ViewBag.CurrentUser.Show" target="_self"><span class=" user_name_show">@ViewBag.CurrentUser.CurrentName</span></a>
                        <a class="item last" href="/User/Logout?sid=@ViewBag.SID" target="_self">注销</a>
                    }
                }
                <a class="item" href="/"><span><i class="icon-feed icon-home"></i>返回首页</span></a>
                <a class="item"><span id="collect-me"><i class="icon-feed icon-collect"></i>加入收藏</span></a>
                <a class="item" href="/Shared/Contact"><span><i class="icon-feed icon-contact"></i>联系我们</span></a>
                <script>
                    $("#collect-me").click(function () {
                        var ctrl = (navigator.userAgent.toLowerCase()).indexOf('mac') != -1 ? 'Command/Cmd' : 'CTRL';
                        if (document.all) {
                            window.external.addFavorite('http://www.51newren.com/', '牛人网');
                        } else if (window.sidebar) {
                            window.sidebar.addPanel('牛人网', 'http://www.51newren.com/', "");
                        } else {
                            alert('您可以尝试通过快捷键' + ctrl + ' + D 加入到收藏夹~');
                        }
                        return false;
                    });
                </script>
            </div>
        </div>
        <div class="clr"></div>
    </div>
    <div class="banner">
        <div class="container">
            <div class="logo">
                <img src="~/Images/logo.png" width="200" height="76">
            </div>
            <div class="search-block">
                <form class="search" action="/Search/Index">
                    <input type="text" placeholder="请输入要寻找的牛人、牛棚" name="key" class="search-query" />
                    <input type="submit" value="搜索" class="search-submit" />
                </form>
                <ul class="show_ul">
                    <li class="line_20 li_left_border">
                        <span class="num_li">牛人数：<strong>@ViewBag.UsersNum</strong></span>
                        <span class="num_li">牛棚数：<strong>@ViewBag.GroupNum</strong></span>
                        <span class="num_li">商家数：<strong>@ViewBag.BusinessNum</strong></span>
                    </li>
                    <li class="line_20 li_left_border">
                        <span class="num_li">行业数：<strong>@ViewBag.IndustriesNum</strong></span>
                        <span class="num_li">工作数：<strong>@ViewBag.JobsNum</strong></span>
                    </li>
                </ul>
                <p class="search-hot">
                    热门搜索词：
                    @foreach (SearchHot item in ViewBag.SearchHot)
                    {
                        <span class="search-li"><a href="/Search/Index?key=@item.Key">@item.Key</a></span>
                    }
                </p>
            </div>

            <div class="clr"></div>
        </div>
    </div>
    <div class="main container">
        <div class="menu">
            <a href="/">
                <div class="menu-item menu-item-hover">首页</div>
            </a>
            <a href="/NewRen/Index">
                <div class="menu-item">找牛人</div>
            </a>
            <a href="/UserGroup/Index">
                <div class="menu-item">找牛棚</div>
            </a>
            <a href="/Anecdote/Index">
                <div class="menu-item">牛人轶事</div>
            </a>
            <a href="/Business/Index">
                <div class="menu-item">商家</div>
            </a>
            <a href="/Shop/Index">
                <div class="menu-item">积分商城</div>
            </a>
            <a href="/Bbs/Index">
                <div class="menu-item">论坛</div>
            </a>
            <a href="/News/Index">
                <div class="menu-item">新闻</div>
            </a>
        </div>

        <div class="scrollleft" id="lstNewRen">
            <ul>
                @foreach (var item in ViewBag.Users as List<User>)
                {
                    <li>
                        <a href="/User/PersonalShow/@item.ID" target="_blank">
                            @if (item.Picture == null)
                            {
                                <img src="/Images/userphoto.png" alt="@item.UserName" />
                            }
                            else
                            {
                                <img src="/User/ShowPicture/@item.ID" alt="@item.UserName" />
                            }
                        </a>
                        <a href="/User/PersonalShow/@item.ID" target="_blank"><strong>@item.UserName</strong></a>
                    </li>
                }
            </ul>
        </div>
        <div id="lstUserGroup" class="scrollleft">
            <ul>
                @foreach (var item in ViewBag.Groups as List<UserGroup>)
                {
                    <li>
                        <a href="/UserGroup/UserGroupShow/@item.ID" target="_blank">
                            @if (item.Picture == null)
                            {
                                <img src="/Images/userphoto.png" alt=@item.GroupName />
                            }
                            else
                            {
                                <img src="/UserGroup/ShowPicture/@item.ID" alt=@item.GroupName />
                            }
                        </a>
                        <a href="/UserGroup/UserGroupShow/@item.ID" target="_blank"><strong class="lstUserGroup-name">@item.GroupName</strong></a>
                    </li>
                }
            </ul>
        </div>

        <div class="top10" id="lstRecommend">
            <h3 class="bottom-boder">
                <span class="lst-title-red">推荐</span>
                <a class="lst-more">更多>></a>
            </h3>
            <div class="top20 left-1 item-body">
                @for (var i = 0; i < Recommend.Count; i++)
                {
                    <div class="item-recommend">
                        @if (Recommend[i].User.Picture == null)
                        {
                            <a class="item-cover" href="/User/PersonalShow/@Recommend[i].User.ID" title="@Recommend[i].User.UserName" style="background-image:url('/Images/userphoto.png')" target="_blank">
                                <p><strong>@Recommend[i].User.RealName</strong></p>
                                <!-- <p style="height:25px"><span>@Recommend[i].User.Job</span></p>-->
                            </a>
                        }
                        else
                        {
                            <a class="item-cover" href="/User/PersonalShow/@Recommend[i].User.ID" title="@Recommend[i].User.UserName" style="background-image:url('/User/ShowPicture/@Recommend[i].User.ID')" target="_blank">
                                <p><strong>@Recommend[i].User.RealName</strong></p>
                            </a>
                                <!-- <p style="height:25px"><span>@Recommend[i].User.Job</span></p>-->
                        }
                    </div>

                }
            </div>
            <div class="clr"></div>
        </div>
        <div id="lstHot" style="position:relative;" class="top20">
            <h3 class="bottom-boder">
                <span class="lst-title-blue">热门</span>
                <a class="lst-more">更多>></a>
            </h3>
            <div class="top20 left-1">
                @foreach (var item in ViewBag.UserHots as List<User>)
                {
                    <div class="headhunting-box fl">
                        <div class="headhunting-photo">
                            <a href="/User/PersonalShow/@item.ID" title="@item.RealName" target="_blank">
                                @if (item.Picture != null)
                                {
                                    <img src="/User/ShowPicture/@item.ID" width="146" height="140" class="pic-hover" />
                                }
                                else
                                {
                                    <img src="~/Images/userphoto.png" width="146" height="140" class="pic-hover" />
                                }
                            </a>
                        </div>
                        <div class="headhunting-info">
                            <dl>
                                <dt>
                                    姓名： <a href="/User/PersonalShow/@item.ID" title="@item.RealName" target="_blank">@item.RealName</a>
                                </dt>
                                <dd>职业：@item.Job</dd>
                                <dd>
                                    手机：@item.Phone
                                </dd>
                                <dd>地址：@item.Address</dd>
                            </dl>
                        </div>
                    </div>
                }
                <div class="clr"></div>
            </div>
        </div>
        <div class="container top20 industries" id="business_container">
            <h3 class="bottom-boder">
                <span class="lst-title-red">商家</span>
                <a class="lst-more" href="/Business/Index">更多>></a>
            </h3>
            <div class="infoTab">
                <ul>
                    @foreach (vIndustryBusiness industries in vindystriesBusiness)
                    {
                        <li class="infoTab_li" id="infoTabBussiness_li_@industries.ID" onmouseover="changetab(this,'rowbusinesstab_@industries.ID','#business_container')">@industries.IndustryName</li>
                    }
                </ul>
            </div>
            @foreach (vIndustryBusiness industries in vindystriesBusiness)
            {
                <div class="infoCon" id="rowbusinesstab_@industries.ID" style="display:none">
                    @foreach (var item in industries.Businesses as List<Business>)
                    {
                        <div class="left right-3 top20 pitem">
                            @if (item.Picture != null)
                            {
                                <a href="/Business/BusinessShow/@item.ID" target="_blank"><img src="/Business/ShowPicture/@item.ID" width="146" height="140" class="pic-hover" /></a>
                            }
                            else
                            {
                                <a href="/Business/BusinessShow/@item.ID" target="_blank"><img src="~/Images/userphoto.png" width="146" height="140" class="pic-hover" /></a>
                            }
                            <a href="/Business/BusinessShow/@item.ID" target="_blank">
                                <strong class="industries-name">@item.BusinessName</strong>
                            </a>
                        </div>
                    }
                </div>
            }
        </div>
        <div class="container top20 industries" id="usergroup_container">
            <h3 class="bottom-boder">
                <span class="lst-title-blue">牛棚</span>
                <a class="lst-more" href="/UserGroup/Index">更多>></a>
            </h3>
            <div class="infoTab">
                <ul>
                    @foreach (vIndustryGroup industries in vindustriesGroup)
                    {
                        <li class="infoTab_li" id="infoTabGroup_li_@industries.ID" onmouseover="changetab(this,'rowgrouptab_@industries.ID','#usergroup_container')">@industries.IndustryName</li>
                    }
                </ul>
            </div>
            @foreach (vIndustryGroup industries in vindustriesGroup)
            {
                <div class="infoCon" id="rowgrouptab_@industries.ID" style="display:none">
                    @foreach (var item in industries.UserGroups as List<UserGroup>)
                    {
                        <div class="left right-3 top20 pitem">
                            @if (item.Picture != null)
                            {
                                <a href="/UserGroup/UserGroupShow/@item.ID" target="_blank"><img src="/UserGroup/ShowPicture/@item.ID" width="146" height="140" class="pic-hover" /></a> <br />
                            }
                            else
                            {
                                <a href="/UserGroup/UserGroupShow/@item.ID" target="_blank">
                                    <img src="~/Images/userphoto.png" width="146" height="140" class="pic-hover" />
                                </a>
                            }
                            <a href="/UserGroup/UserGroupShow/@item.ID" target="_blank">
                                <strong class="industries-name">@item.GroupName</strong>
                            </a>
                        </div>
                    }
                </div>
            }
        </div>

        <div class="container top20 anecdote">
            <h3 class="bottom-boder">
                <span class="lst-title-red">轶事</span>
                <a class="lst-more" href="/Anecdote/Index">更多>></a>
            </h3>
            <div class="section">
                @foreach (vAnecdote item in ViewBag.Anecdotes)
                {
                    <div class="anecdote-div card col-sm-5 col-sm-4 col-lg-3" id="anecdote_@item.ID">
                        <a href="/Anecdote/Show/@item.ID" target="_blank">
                            <h4>@item.Title</h4>
                        </a>
                        <h5>@item.Time</h5>
                        <p class="anecdote-p">@Html.Raw(item.Sumamry)</p>
                    </div>
                }
            </div>
        </div>
    </div>

    @if (vindustriesGroup.Count > 0)
            {
        <script>
            changetab('#infoTabGroup_li_@vindustriesGroup[0].ID', 'rowgrouptab_@vindustriesGroup[0].ID', 'usergroup_container');
        </script>
    }
    @if (vindystriesBusiness.Count > 0)
    {
        <script>
            changetab('#infoTabBussiness_li_@vindystriesBusiness[0].ID', 'rowbusinesstab_@vindystriesBusiness[0].ID', 'business_container');
        </script>
    }
    <script>
        $(".scrollleft").imgscroll({
            speed: 50,    //图片滚动速度
            amount: 0,    //图片滚动过渡时间
            width: 1,     //图片滚动步数
            dir: "left"   // "left" 或 "up" 向左或向上滚动
        });
        $(".anecdote-p").each(function () {
            var div_height = $(this).parent(".anecdote-div").height();
            var div_h4_height = $(this).parent(".anecdote-div").find("h4").height();
            var div_h5_height = $(this).parent(".anecdote-div").children("h5").height();
            var div_p_height = div_height - div_h4_height - div_h5_height - 20;
            $(this).height(div_p_height);
        });
    </script>
    <div class="footer-container top30 footer-width" >
        <div class="footer top-line top30 footer-width">
            <p class="friend-href table-center">
                <span style="width:70px;">友情链接：</span>
                @foreach (var item in ViewBag.Links as List<Link>)
            {
                    <span><a href="@item.URL" target="_blank">@item.Title</a></span>
                }
            </p>
            <p>
                <span><a href="/" class="on">首页</a> </span>|
                <span><a href="/About.html">关于我们</a> </span>|
                <span><a href="/Join.html">加入我们</a> </span>|
                <span><a href="/Contact.html">联系我们</a> </span>|
                <span><a href="/Serviceterm.html">服务条款</a> </span>|
                <span><a href="/Bbs/Index">论坛</a></span>
            </p>
        </div>
        <div class="wrapper footer-width">
            <div class="copyright">
                <p class="small">
                    Copyright © 2015 湖北牛人网络工程有限公司 All rights reserved. 鄂ICP备15014961号-1&nbsp;&nbsp;
                    <script type="text/javascript">var cnzz_protocol = (("https:" == document.location.protocol) ? " https://" : " http://"); document.write(unescape("%3Cspan id='cnzz_stat_icon_1256053577'%3E%3C/span%3E%3Cscript src='" + cnzz_protocol + "s11.cnzz.com/stat.php%3Fid%3D1256053577%26show%3Dpic' type='text/javascript'%3E%3C/script%3E"));
                    </script>
                </p>
            </div>
        </div>
    </div>
    <script>
        $(".footer-width").width(document.body.scrollWidth);
    </script>
</body>
</html>